package me.yobol.greentable.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import me.yobol.greentable.commons.path.PPath;

/**
 * @author Yobol
 *
 */
public class LoginOutServlet extends HttpServlet {

	private static final long serialVersionUID = -2676642310572113972L;

	public LoginOutServlet() {
		super();
	}

	public void init() throws ServletException {
		// Put your code here
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// Put your code here
		doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// Put your code here
		request.getSession().invalidate();
		response.sendRedirect(PPath.pIndex(request));
	}

	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

}
